package com.ruoyi.merchant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 银行卡类型枚举
 */
@Getter
@AllArgsConstructor
public enum CardTypeEnum {
    
    DEBIT_CARD(1, "借记卡"),
    CREDIT_CARD(2, "贷记卡"),
    CORPORATE_ACCOUNT(3, "对公账户");
    
    private final Integer code;
    private final String desc;
    
    public static String getDescByCode(Integer code) {
        if (code == null) {
            return "";
        }
        for (CardTypeEnum type : values()) {
            if (type.getCode().equals(code)) {
                return type.getDesc();
            }
        }
        return "";
    }
}
